home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- public class Thread implements Runnable {
- private char[] name;
- private int priority;
- private Thread threadQ;
- private int PrivateInfo;
- private int eetop;
- private boolean single_step;
- private boolean daemon = false;
- private boolean stillborn = false;
- private Runnable target;
- private boolean interruptRequested = false;
- private static Thread activeThreadQ;
- private ThreadGroup group;
- private static int threadInitNumber;
- public static final int MIN_PRIORITY = 1;
- public static final int NORM_PRIORITY = 5;
- public static final int MAX_PRIORITY = 10;
-
- private static synchronized int nextThreadNum() {
- return threadInitNumber++;
- }
-
- public static native Thread currentThread();
-
- public static native void yield();
-
- public static native void sleep(long var0) throws InterruptedException;
-
- public static void sleep(long var0, int var2) throws InterruptedException {
- if (var2 > 500000) {
- ++var0;
- }
-
- sleep(var0);
- }
-
- private void init(ThreadGroup var1, Runnable var2, String var3) {
- Thread var4 = currentThread();
- if (var1 == null) {
- var1 = var4.group;
- } else {
- var1.checkAccess();
- }
-
- this.group = var1;
- this.daemon = var4.daemon;
- this.priority = var4.priority;
- this.name = var3.toCharArray();
- this.target = var2;
- this.setPriority0(this.priority);
- var1.add(this);
- }
-
- public Thread() {
- this.init((ThreadGroup)null, (Runnable)null, "Thread-" + nextThreadNum());
- }
-
- public Thread(Runnable var1) {
- this.init((ThreadGroup)null, var1, "Thread-" + nextThreadNum());
- }
-
- public Thread(ThreadGroup var1, Runnable var2) {
- this.init(var1, var2, "Thread-" + nextThreadNum());
- }
-
- public Thread(String var1) {
- this.init((ThreadGroup)null, (Runnable)null, var1);
- }
-
- public Thread(ThreadGroup var1, String var2) {
- this.init(var1, (Runnable)null, var2);
- }
-
- public Thread(Runnable var1, String var2) {
- this.init((ThreadGroup)null, var1, var2);
- }
-
- public Thread(ThreadGroup var1, Runnable var2, String var3) {
- this.init(var1, var2, var3);
- }
-
- public synchronized native void start();
-
- public void run() {
- if (this.target != null) {
- this.target.run();
- }
-
- }
-
- private void exit() {
- if (this.group != null) {
- this.group.remove(this);
- this.group = null;
- }
-
- }
-
- public final void stop() {
- this.stop(new ThreadDeath());
- }
-
- public final synchronized void stop(Throwable var1) {
- this.checkAccess();
- this.stop0(var1);
- }
-
- public void interrupt() {
- this.interruptRequested = true;
- }
-
- public static boolean interrupted() {
- return currentThread().interruptRequested;
- }
-
- public boolean isInterrupted() {
- return this.interruptRequested;
- }
-
- public void destroy() {
- throw new NoSuchMethodError();
- }
-
- public final native boolean isAlive();
-
- public final void suspend() {
- this.checkAccess();
- this.suspend0();
- }
-
- public final void resume() {
- this.checkAccess();
- this.resume0();
- }
-
- public final void setPriority(int var1) {
- this.checkAccess();
- if (var1 <= 10 && var1 >= 1) {
- ThreadGroup var2 = this.group;
- if (var1 > var2.maxPriority) {
- var2 = this.group;
- var1 = var2.maxPriority;
- }
-
- this.setPriority0(this.priority = var1);
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- public final int getPriority() {
- return this.priority;
- }
-
- public final void setName(String var1) {
- this.checkAccess();
- this.name = var1.toCharArray();
- }
-
- public final String getName() {
- char[] var1 = this.name;
- return new String(var1);
- }
-
- public final ThreadGroup getThreadGroup() {
- return this.group;
- }
-
- public static int activeCount() {
- Thread var0 = currentThread();
- return var0.group.activeCount();
- }
-
- public static int enumerate(Thread[] var0) {
- Thread var1 = currentThread();
- return var1.group.enumerate(var0);
- }
-
- public native int countStackFrames();
-
- public final synchronized void join(long var1) throws InterruptedException {
- long var3 = System.currentTimeMillis();
- long var5 = 0L;
- if (var1 == 0L) {
- while(this.isAlive()) {
- this.wait(0L);
- }
-
- } else {
- while(this.isAlive()) {
- long var7 = var1 - var5;
- if (var7 <= 0L) {
- break;
- }
-
- this.wait(var7);
- var5 = System.currentTimeMillis() - var3;
- }
-
- }
- }
-
- public final synchronized void join(long var1, int var3) throws InterruptedException {
- if (var3 >= 500000 || var1 == 0L) {
- ++var1;
- }
-
- this.join(var1);
- }
-
- public final void join() throws InterruptedException {
- this.join(0L);
- }
-
- public static void dumpStack() {
- (new Exception("Stack trace")).printStackTrace();
- }
-
- public final void setDaemon(boolean var1) {
- this.checkAccess();
- if (this.isAlive()) {
- throw new IllegalThreadStateException();
- } else {
- this.daemon = var1;
- }
- }
-
- public final boolean isDaemon() {
- return this.daemon;
- }
-
- public void checkAccess() {
- SecurityManager var1 = System.security;
- if (var1 != null) {
- var1.checkAccess(this);
- }
-
- }
-
- public String toString() {
- StringBuffer var10000 = (new StringBuffer()).append("Thread[");
- char[] var1 = this.name;
- var10000 = var10000.append(new String(var1)).append(",").append(this.priority).append(",");
- ThreadGroup var2 = this.group;
- return var10000.append(var2.name).append("]").toString();
- }
-
- private native void setPriority0(int var1);
-
- private native void stop0(Object var1);
-
- private native void suspend0();
-
- private native void resume0();
- }
-